<!-- HTML header for doxygen 1.8.20-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=9"/>
	<meta name="generator" content="Doxygen 1.9.4"/>
	<meta name="viewport" content="width=device-width, initial-scale=1"/>
	<title>Raspberry Pi Pico SDK: hardware_sync</title>
	<!-- <link href="tabs.css" rel="stylesheet" type="text/css"/> -->
	<script type="text/javascript" src="jquery.js"></script>
	<script type="text/javascript" src="dynsections.js"></script>
	<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
	<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
	<link href="doxygen.css" rel="stylesheet" type="text/css" />
	<link href="normalise.css" rel="stylesheet" type="text/css"/>
<link href="main.css" rel="stylesheet" type="text/css"/>
<link href="styles.css" rel="stylesheet" type="text/css"/>
</head>
<body>
	<div class="navigation-mobile">
		<div class="logo--mobile">
			<a href="/"><img src="logo-mobile.svg" alt="Raspberry Pi"></a>
		</div>
		<div class="navigation-toggle">
			<span class="line-1"></span>
			<span class="line-2">
				<p>Menu Toggle</p>
			</span>
			<span class="line-3"></span>
		</div>
	</div>
	<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
		<div class="logo">
			<a href="index.html"> <img src="logo.svg" alt="Raspberry Pi"></a>
			<span style="display: inline-block; margin-top: 10px;">
				v2.0.0
			</span>
		</div>
		<div class="navigation-footer">
			<img src="logo-mobile.svg" alt="Raspberry Pi">
			<a href="https://www.raspberrypi.com/" target="_blank">By Raspberry Pi Ltd</a>
		</div>
<!-- 		<div class="search">
			<form>
				<input type="search" name="search" id="search" placeholder="Search">
				<input type="submit" value="Search">
			</form>
		</div> -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__hardware__sync.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">hardware_sync<div class="ingroups"><a class="el" href="group__hardware.html">Hardware APIs</a></div></div></div>
</div><!--header-->
<div class="contents">

<p>Low level hardware spin locks, barrier and processor event APIs.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:gae73045822d06a1733a5bbfbda7895998"><td class="memItemLeft" align="right" valign="top"><a id="gae73045822d06a1733a5bbfbda7895998" name="gae73045822d06a1733a5bbfbda7895998"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>SW_SPIN_LOCK_TYPE</b>&#160;&#160;&#160;volatile uint8_t</td></tr>
<tr class="memdesc:gae73045822d06a1733a5bbfbda7895998"><td class="mdescLeft">&#160;</td><td class="mdescRight">A spin lock identifier. <br /></td></tr>
<tr class="separator:gae73045822d06a1733a5bbfbda7895998"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga9442d73d817ec600c67a632edf8c6668"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__sync.html#ga9442d73d817ec600c67a632edf8c6668">__nop</a> (void)</td></tr>
<tr class="memdesc:ga9442d73d817ec600c67a632edf8c6668"><td class="mdescLeft">&#160;</td><td class="mdescRight">Insert a NOP instruction in to the code path.  <a href="group__hardware__sync.html#ga9442d73d817ec600c67a632edf8c6668">More...</a><br /></td></tr>
<tr class="separator:ga9442d73d817ec600c67a632edf8c6668"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga486eada32246494118f8273a80ae6856"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__sync.html#ga486eada32246494118f8273a80ae6856">__sev</a> (void)</td></tr>
<tr class="memdesc:ga486eada32246494118f8273a80ae6856"><td class="mdescLeft">&#160;</td><td class="mdescRight">Insert a SEV instruction in to the code path.  <a href="group__hardware__sync.html#ga486eada32246494118f8273a80ae6856">More...</a><br /></td></tr>
<tr class="separator:ga486eada32246494118f8273a80ae6856"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7799a0b9fc6444d463170266392f5fcd"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__sync.html#ga7799a0b9fc6444d463170266392f5fcd">__wfe</a> (void)</td></tr>
<tr class="memdesc:ga7799a0b9fc6444d463170266392f5fcd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Insert a WFE instruction in to the code path.  <a href="group__hardware__sync.html#ga7799a0b9fc6444d463170266392f5fcd">More...</a><br /></td></tr>
<tr class="separator:ga7799a0b9fc6444d463170266392f5fcd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaaf83973c85c4d0987d34f31ff9590ec5"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__sync.html#gaaf83973c85c4d0987d34f31ff9590ec5">__wfi</a> (void)</td></tr>
<tr class="memdesc:gaaf83973c85c4d0987d34f31ff9590ec5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Insert a WFI instruction in to the code path.  <a href="group__hardware__sync.html#gaaf83973c85c4d0987d34f31ff9590ec5">More...</a><br /></td></tr>
<tr class="separator:gaaf83973c85c4d0987d34f31ff9590ec5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga577b1aba04c5e961c151c2b5d116618d"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__sync.html#ga577b1aba04c5e961c151c2b5d116618d">__dmb</a> (void)</td></tr>
<tr class="memdesc:ga577b1aba04c5e961c151c2b5d116618d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Insert a DMB instruction in to the code path.  <a href="group__hardware__sync.html#ga577b1aba04c5e961c151c2b5d116618d">More...</a><br /></td></tr>
<tr class="separator:ga577b1aba04c5e961c151c2b5d116618d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf9544395481cc10fe75df2e8fe58d52a"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__sync.html#gaf9544395481cc10fe75df2e8fe58d52a">__dsb</a> (void)</td></tr>
<tr class="memdesc:gaf9544395481cc10fe75df2e8fe58d52a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Insert a DSB instruction in to the code path.  <a href="group__hardware__sync.html#gaf9544395481cc10fe75df2e8fe58d52a">More...</a><br /></td></tr>
<tr class="separator:gaf9544395481cc10fe75df2e8fe58d52a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae516e592b0d308fe5b032e34109b0057"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__sync.html#gae516e592b0d308fe5b032e34109b0057">__isb</a> (void)</td></tr>
<tr class="memdesc:gae516e592b0d308fe5b032e34109b0057"><td class="mdescLeft">&#160;</td><td class="mdescRight">Insert a ISB instruction in to the code path.  <a href="group__hardware__sync.html#gae516e592b0d308fe5b032e34109b0057">More...</a><br /></td></tr>
<tr class="separator:gae516e592b0d308fe5b032e34109b0057"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaac3457fdba1624e5f45e7f936ad68049"><td class="memItemLeft" align="right" valign="top"><a id="gaac3457fdba1624e5f45e7f936ad68049" name="gaac3457fdba1624e5f45e7f936ad68049"></a>
static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> void&#160;</td><td class="memItemRight" valign="bottom"><b>__mem_fence_acquire</b> (void)</td></tr>
<tr class="memdesc:gaac3457fdba1624e5f45e7f936ad68049"><td class="mdescLeft">&#160;</td><td class="mdescRight">Acquire a memory fence. <br /></td></tr>
<tr class="separator:gaac3457fdba1624e5f45e7f936ad68049"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1a9f3cba87fe49a3907a1535b9adfa3f"><td class="memItemLeft" align="right" valign="top"><a id="ga1a9f3cba87fe49a3907a1535b9adfa3f" name="ga1a9f3cba87fe49a3907a1535b9adfa3f"></a>
static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> void&#160;</td><td class="memItemRight" valign="bottom"><b>__mem_fence_release</b> (void)</td></tr>
<tr class="memdesc:ga1a9f3cba87fe49a3907a1535b9adfa3f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Release a memory fence. <br /></td></tr>
<tr class="separator:ga1a9f3cba87fe49a3907a1535b9adfa3f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga15ada9cfb92615e5bb05a29aa3fc7ad8"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__sync.html#ga15ada9cfb92615e5bb05a29aa3fc7ad8">save_and_disable_interrupts</a> (void)</td></tr>
<tr class="memdesc:ga15ada9cfb92615e5bb05a29aa3fc7ad8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Save and disable interrupts.  <a href="group__hardware__sync.html#ga15ada9cfb92615e5bb05a29aa3fc7ad8">More...</a><br /></td></tr>
<tr class="separator:ga15ada9cfb92615e5bb05a29aa3fc7ad8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga863cdac424a18c8ebfcc62107a4c2ad2"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__sync.html#ga863cdac424a18c8ebfcc62107a4c2ad2">restore_interrupts</a> (uint32_t status)</td></tr>
<tr class="memdesc:ga863cdac424a18c8ebfcc62107a4c2ad2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Restore interrupts to a specified state.  <a href="group__hardware__sync.html#ga863cdac424a18c8ebfcc62107a4c2ad2">More...</a><br /></td></tr>
<tr class="separator:ga863cdac424a18c8ebfcc62107a4c2ad2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4bb69d1717ab90105ea05b82291fc0c7"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__sync.html#ga4bb69d1717ab90105ea05b82291fc0c7">restore_interrupts_from_disabled</a> (uint32_t status)</td></tr>
<tr class="memdesc:ga4bb69d1717ab90105ea05b82291fc0c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Restore interrupts to a specified state with restricted transitions.  <a href="group__hardware__sync.html#ga4bb69d1717ab90105ea05b82291fc0c7">More...</a><br /></td></tr>
<tr class="separator:ga4bb69d1717ab90105ea05b82291fc0c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8f4578aa492d4d37dfbdab5c99ab5b1c"><td class="memItemLeft" align="right" valign="top">uint&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__sync.html#ga8f4578aa492d4d37dfbdab5c99ab5b1c">next_striped_spin_lock_num</a> (void)</td></tr>
<tr class="memdesc:ga8f4578aa492d4d37dfbdab5c99ab5b1c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return a spin lock number from the <em>striped</em> range.  <a href="group__hardware__sync.html#ga8f4578aa492d4d37dfbdab5c99ab5b1c">More...</a><br /></td></tr>
<tr class="separator:ga8f4578aa492d4d37dfbdab5c99ab5b1c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga50945cb4c33c3263b69e1fce81c474c7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__sync.html#ga50945cb4c33c3263b69e1fce81c474c7">spin_lock_claim</a> (uint lock_num)</td></tr>
<tr class="memdesc:ga50945cb4c33c3263b69e1fce81c474c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Mark a spin lock as used.  <a href="group__hardware__sync.html#ga50945cb4c33c3263b69e1fce81c474c7">More...</a><br /></td></tr>
<tr class="separator:ga50945cb4c33c3263b69e1fce81c474c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga41304e0ee0aed1b5c20b0fd8c2adf9e6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__sync.html#ga41304e0ee0aed1b5c20b0fd8c2adf9e6">spin_lock_claim_mask</a> (uint32_t lock_num_mask)</td></tr>
<tr class="memdesc:ga41304e0ee0aed1b5c20b0fd8c2adf9e6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Mark multiple spin locks as used.  <a href="group__hardware__sync.html#ga41304e0ee0aed1b5c20b0fd8c2adf9e6">More...</a><br /></td></tr>
<tr class="separator:ga41304e0ee0aed1b5c20b0fd8c2adf9e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga177efc085451e4eabfc726897a59ca57"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__sync.html#ga177efc085451e4eabfc726897a59ca57">spin_lock_unclaim</a> (uint lock_num)</td></tr>
<tr class="memdesc:ga177efc085451e4eabfc726897a59ca57"><td class="mdescLeft">&#160;</td><td class="mdescRight">Mark a spin lock as no longer used.  <a href="group__hardware__sync.html#ga177efc085451e4eabfc726897a59ca57">More...</a><br /></td></tr>
<tr class="separator:ga177efc085451e4eabfc726897a59ca57"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga157bccb525bdfd90255490558cbeb9c0"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__sync.html#ga157bccb525bdfd90255490558cbeb9c0">spin_lock_claim_unused</a> (bool required)</td></tr>
<tr class="memdesc:ga157bccb525bdfd90255490558cbeb9c0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Claim a free spin lock.  <a href="group__hardware__sync.html#ga157bccb525bdfd90255490558cbeb9c0">More...</a><br /></td></tr>
<tr class="separator:ga157bccb525bdfd90255490558cbeb9c0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9c66da8cbd0916461d6de2af4340ec4f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__sync.html#ga9c66da8cbd0916461d6de2af4340ec4f">spin_lock_is_claimed</a> (uint lock_num)</td></tr>
<tr class="memdesc:ga9c66da8cbd0916461d6de2af4340ec4f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Determine if a spin lock is claimed.  <a href="group__hardware__sync.html#ga9c66da8cbd0916461d6de2af4340ec4f">More...</a><br /></td></tr>
<tr class="separator:ga9c66da8cbd0916461d6de2af4340ec4f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga87b2474d96a8de8cdc6e083680a05bb9"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> spin_lock_t *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__sync.html#ga87b2474d96a8de8cdc6e083680a05bb9">spin_lock_instance</a> (uint lock_num)</td></tr>
<tr class="memdesc:ga87b2474d96a8de8cdc6e083680a05bb9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get HW Spinlock instance from number.  <a href="group__hardware__sync.html#ga87b2474d96a8de8cdc6e083680a05bb9">More...</a><br /></td></tr>
<tr class="separator:ga87b2474d96a8de8cdc6e083680a05bb9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad86f015d3ed475401bf83d9a0e449ab1"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> uint&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__sync.html#gad86f015d3ed475401bf83d9a0e449ab1">spin_lock_get_num</a> (spin_lock_t *lock)</td></tr>
<tr class="memdesc:gad86f015d3ed475401bf83d9a0e449ab1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get HW Spinlock number from instance.  <a href="group__hardware__sync.html#gad86f015d3ed475401bf83d9a0e449ab1">More...</a><br /></td></tr>
<tr class="separator:gad86f015d3ed475401bf83d9a0e449ab1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac4c9286f66d9dbe5287904d481f3b1e3"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__sync.html#gac4c9286f66d9dbe5287904d481f3b1e3">spin_lock_unsafe_blocking</a> (spin_lock_t *lock)</td></tr>
<tr class="memdesc:gac4c9286f66d9dbe5287904d481f3b1e3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Acquire a spin lock without disabling interrupts (hence unsafe)  <a href="group__hardware__sync.html#gac4c9286f66d9dbe5287904d481f3b1e3">More...</a><br /></td></tr>
<tr class="separator:gac4c9286f66d9dbe5287904d481f3b1e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1cc04df1f5717292b279eb197ff5b4af"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__sync.html#ga1cc04df1f5717292b279eb197ff5b4af">spin_unlock_unsafe</a> (spin_lock_t *lock)</td></tr>
<tr class="memdesc:ga1cc04df1f5717292b279eb197ff5b4af"><td class="mdescLeft">&#160;</td><td class="mdescRight">Release a spin lock without re-enabling interrupts.  <a href="group__hardware__sync.html#ga1cc04df1f5717292b279eb197ff5b4af">More...</a><br /></td></tr>
<tr class="separator:ga1cc04df1f5717292b279eb197ff5b4af"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga091e88a7608ed8dbf3e1e984bae54602"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__sync.html#ga091e88a7608ed8dbf3e1e984bae54602">spin_lock_blocking</a> (spin_lock_t *lock)</td></tr>
<tr class="memdesc:ga091e88a7608ed8dbf3e1e984bae54602"><td class="mdescLeft">&#160;</td><td class="mdescRight">Acquire a spin lock safely.  <a href="group__hardware__sync.html#ga091e88a7608ed8dbf3e1e984bae54602">More...</a><br /></td></tr>
<tr class="separator:ga091e88a7608ed8dbf3e1e984bae54602"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gada2be3ad9fabcda77e8bec99e12333fd"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__sync.html#gada2be3ad9fabcda77e8bec99e12333fd">is_spin_locked</a> (spin_lock_t *lock)</td></tr>
<tr class="memdesc:gada2be3ad9fabcda77e8bec99e12333fd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check to see if a spinlock is currently acquired elsewhere.  <a href="group__hardware__sync.html#gada2be3ad9fabcda77e8bec99e12333fd">More...</a><br /></td></tr>
<tr class="separator:gada2be3ad9fabcda77e8bec99e12333fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga281ce69786da23cab7ba6c42537d4e87"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__sync.html#ga281ce69786da23cab7ba6c42537d4e87">spin_unlock</a> (spin_lock_t *lock, uint32_t saved_irq)</td></tr>
<tr class="memdesc:ga281ce69786da23cab7ba6c42537d4e87"><td class="mdescLeft">&#160;</td><td class="mdescRight">Release a spin lock safely.  <a href="group__hardware__sync.html#ga281ce69786da23cab7ba6c42537d4e87">More...</a><br /></td></tr>
<tr class="separator:ga281ce69786da23cab7ba6c42537d4e87"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad38821cab3d935b009c6551d5ff70c4c"><td class="memItemLeft" align="right" valign="top">spin_lock_t *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hardware__sync.html#gad38821cab3d935b009c6551d5ff70c4c">spin_lock_init</a> (uint lock_num)</td></tr>
<tr class="memdesc:gad38821cab3d935b009c6551d5ff70c4c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialise a spin lock.  <a href="group__hardware__sync.html#gad38821cab3d935b009c6551d5ff70c4c">More...</a><br /></td></tr>
<tr class="separator:gad38821cab3d935b009c6551d5ff70c4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga667a78000c57bdfb3585cbc56fccbe0b"><td class="memItemLeft" align="right" valign="top"><a id="ga667a78000c57bdfb3585cbc56fccbe0b" name="ga667a78000c57bdfb3585cbc56fccbe0b"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>spin_locks_reset</b> (void)</td></tr>
<tr class="memdesc:ga667a78000c57bdfb3585cbc56fccbe0b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Release all spin locks. <br /></td></tr>
<tr class="separator:ga667a78000c57bdfb3585cbc56fccbe0b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p >Low level hardware spin locks, barrier and processor event APIs. </p>
<h2><a class="anchor" id="autotoc_md1"></a>
Spin Locks</h2>
<p >The RP-series microcontrollers provide 32 hardware spin locks, which can be used to manage mutually-exclusive access to shared software and hardware resources.</p>
<p >Generally each spin lock itself is a shared resource, i.e. the same hardware spin lock can be used by multiple higher level primitives (as long as the spin locks are neither held for long periods, nor held concurrently with other spin locks by the same core - which could lead to deadlock). A hardware spin lock that is exclusively owned can be used individually without more flexibility and without regard to other software. Note that no hardware spin lock may be acquired re-entrantly (i.e. hardware spin locks are not on their own safe for use by both thread code and IRQs) however the default spinlock related methods here (e.g. <a class="el" href="group__hardware__sync.html#ga091e88a7608ed8dbf3e1e984bae54602">spin_lock_blocking</a>) always disable interrupts while the lock is held as use by IRQ handlers and user code is common/desirable, and spin locks are only expected to be held for brief periods.</p>
<p >RP2350 Warning. Due to erratum RP2350-E2, writes to new SIO registers above an offset of +0x180 alias the spinlocks, causing spurious lock releases. This SDK by default uses atomic memory accesses to implement the hardware_sync_spin_lock API, as a workaround on RP2350 A2. </p>
<p >The SDK uses the following default spin lock assignments, classifying which spin locks are reserved for exclusive/special purposes vs those suitable for more general shared use:</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadCenter">Number (ID)   </th><th class="markdownTableHeadNone">Description    </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter">0-13   </td><td class="markdownTableBodyNone">Currently reserved for exclusive use by the SDK and other libraries. If you use these spin locks, you risk breaking SDK or other library functionality. Each reserved spin lock used individually has its own PICO_SPINLOCK_ID so you can search for those.    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter">14,15   </td><td class="markdownTableBodyNone">(PICO_SPINLOCK_ID_OS1 and PICO_SPINLOCK_ID_OS2). Currently reserved for exclusive use by an operating system (or other system level software) co-existing with the SDK.    </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyCenter">16-23   </td><td class="markdownTableBodyNone">(PICO_SPINLOCK_ID_STRIPED_FIRST - PICO_SPINLOCK_ID_STRIPED_LAST). Spin locks from this range are assigned in a round-robin fashion via <a class="el" href="group__hardware__sync.html#ga8f4578aa492d4d37dfbdab5c99ab5b1c">next_striped_spin_lock_num()</a>. These spin locks are shared, but assigning numbers from a range reduces the probability that two higher level locking primitives using <em>striped</em> spin locks will actually be using the same spin lock.    </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyCenter">24-31   </td><td class="markdownTableBodyNone">(PICO_SPINLOCK_ID_CLAIM_FREE_FIRST - PICO_SPINLOCK_ID_CLAIM_FREE_LAST). These are reserved for exclusive use and are allocated on a first come first served basis at runtime via <a class="el" href="group__hardware__sync.html#ga157bccb525bdfd90255490558cbeb9c0">spin_lock_claim_unused()</a>   </td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga577b1aba04c5e961c151c2b5d116618d" name="ga577b1aba04c5e961c151c2b5d116618d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga577b1aba04c5e961c151c2b5d116618d">&#9670;&nbsp;</a></span>__dmb()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> void __dmb </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Insert a DMB instruction in to the code path. </p>
<p >The DMB (data memory barrier) acts as a memory barrier, all memory accesses prior to this instruction will be observed before any explicit access after the instruction. </p>

</div>
</div>
<a id="gaf9544395481cc10fe75df2e8fe58d52a" name="gaf9544395481cc10fe75df2e8fe58d52a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf9544395481cc10fe75df2e8fe58d52a">&#9670;&nbsp;</a></span>__dsb()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> void __dsb </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Insert a DSB instruction in to the code path. </p>
<p >The DSB (data synchronization barrier) acts as a special kind of data memory barrier (DMB). The DSB operation completes when all explicit memory accesses before this instruction complete. </p>

</div>
</div>
<a id="gae516e592b0d308fe5b032e34109b0057" name="gae516e592b0d308fe5b032e34109b0057"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae516e592b0d308fe5b032e34109b0057">&#9670;&nbsp;</a></span>__isb()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> void __isb </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Insert a ISB instruction in to the code path. </p>
<p >ISB acts as an instruction synchronization barrier. It flushes the pipeline of the processor, so that all instructions following the ISB are fetched from cache or memory again, after the ISB instruction has been completed. </p>

</div>
</div>
<a id="ga9442d73d817ec600c67a632edf8c6668" name="ga9442d73d817ec600c67a632edf8c6668"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9442d73d817ec600c67a632edf8c6668">&#9670;&nbsp;</a></span>__nop()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> void __nop </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Insert a NOP instruction in to the code path. </p>
<p >NOP does nothing for one cycle. On RP2350 Arm binaries this is forced to be a 32-bit instruction to avoid dual-issue of NOPs. </p>

</div>
</div>
<a id="ga486eada32246494118f8273a80ae6856" name="ga486eada32246494118f8273a80ae6856"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga486eada32246494118f8273a80ae6856">&#9670;&nbsp;</a></span>__sev()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> void __sev </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Insert a SEV instruction in to the code path. </p>
<p >The SEV (send event) instruction sends an event to both cores. </p>

</div>
</div>
<a id="ga7799a0b9fc6444d463170266392f5fcd" name="ga7799a0b9fc6444d463170266392f5fcd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7799a0b9fc6444d463170266392f5fcd">&#9670;&nbsp;</a></span>__wfe()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> void __wfe </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Insert a WFE instruction in to the code path. </p>
<p >The WFE (wait for event) instruction waits until one of a number of events occurs, including events signalled by the SEV instruction on either core. </p>

</div>
</div>
<a id="gaaf83973c85c4d0987d34f31ff9590ec5" name="gaaf83973c85c4d0987d34f31ff9590ec5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaaf83973c85c4d0987d34f31ff9590ec5">&#9670;&nbsp;</a></span>__wfi()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> void __wfi </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Insert a WFI instruction in to the code path. </p>
<p >The WFI (wait for interrupt) instruction waits for a interrupt to wake up the core. </p>

</div>
</div>
<a id="gada2be3ad9fabcda77e8bec99e12333fd" name="gada2be3ad9fabcda77e8bec99e12333fd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gada2be3ad9fabcda77e8bec99e12333fd">&#9670;&nbsp;</a></span>is_spin_locked()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool is_spin_locked </td>
          <td>(</td>
          <td class="paramtype">spin_lock_t *&#160;</td>
          <td class="paramname"><em>lock</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Check to see if a spinlock is currently acquired elsewhere. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">lock</td><td>Spinlock instance </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga8f4578aa492d4d37dfbdab5c99ab5b1c" name="ga8f4578aa492d4d37dfbdab5c99ab5b1c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8f4578aa492d4d37dfbdab5c99ab5b1c">&#9670;&nbsp;</a></span>next_striped_spin_lock_num()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint next_striped_spin_lock_num </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return a spin lock number from the <em>striped</em> range. </p>
<p >Returns a spin lock number in the range PICO_SPINLOCK_ID_STRIPED_FIRST to PICO_SPINLOCK_ID_STRIPED_LAST in a round robin fashion. This does not grant the caller exclusive access to the spin lock, so the caller must:</p>
<ol type="1">
<li>Abide (with other callers) by the contract of only holding this spin lock briefly (and with IRQs disabled - the default via <a class="el" href="group__hardware__sync.html#ga091e88a7608ed8dbf3e1e984bae54602">spin_lock_blocking()</a>), and not whilst holding other spin locks.</li>
<li>Be OK with any contention caused by the - brief due to the above requirement - contention with other possible users of the spin lock.</li>
</ol>
<dl class="section return"><dt>Returns</dt><dd>lock_num a spin lock number the caller may use (non exclusively) </dd></dl>
<dl class="section see"><dt>See also</dt><dd>PICO_SPINLOCK_ID_STRIPED_FIRST </dd>
<dd>
PICO_SPINLOCK_ID_STRIPED_LAST </dd></dl>

</div>
</div>
<a id="ga863cdac424a18c8ebfcc62107a4c2ad2" name="ga863cdac424a18c8ebfcc62107a4c2ad2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga863cdac424a18c8ebfcc62107a4c2ad2">&#9670;&nbsp;</a></span>restore_interrupts()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> void restore_interrupts </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>status</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Restore interrupts to a specified state. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">status</td><td>Previous interrupt status from <a class="el" href="group__hardware__sync.html#ga15ada9cfb92615e5bb05a29aa3fc7ad8" title="Save and disable interrupts.">save_and_disable_interrupts()</a> </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga4bb69d1717ab90105ea05b82291fc0c7" name="ga4bb69d1717ab90105ea05b82291fc0c7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4bb69d1717ab90105ea05b82291fc0c7">&#9670;&nbsp;</a></span>restore_interrupts_from_disabled()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> void restore_interrupts_from_disabled </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>status</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Restore interrupts to a specified state with restricted transitions. </p>
<p >This method should only be used when the interrupt state is known to be disabled, e.g. when paired with <a class="el" href="group__hardware__sync.html#ga15ada9cfb92615e5bb05a29aa3fc7ad8">save_and_disable_interrupts()</a></p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">status</td><td>Previous interrupt status from <a class="el" href="group__hardware__sync.html#ga15ada9cfb92615e5bb05a29aa3fc7ad8" title="Save and disable interrupts.">save_and_disable_interrupts()</a> </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga15ada9cfb92615e5bb05a29aa3fc7ad8" name="ga15ada9cfb92615e5bb05a29aa3fc7ad8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga15ada9cfb92615e5bb05a29aa3fc7ad8">&#9670;&nbsp;</a></span>save_and_disable_interrupts()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> uint32_t save_and_disable_interrupts </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Save and disable interrupts. </p>
<dl class="section return"><dt>Returns</dt><dd>The prior interrupt enable status for restoration later via <a class="el" href="group__hardware__sync.html#ga863cdac424a18c8ebfcc62107a4c2ad2" title="Restore interrupts to a specified state.">restore_interrupts()</a> </dd></dl>

</div>
</div>
<a id="ga091e88a7608ed8dbf3e1e984bae54602" name="ga091e88a7608ed8dbf3e1e984bae54602"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga091e88a7608ed8dbf3e1e984bae54602">&#9670;&nbsp;</a></span>spin_lock_blocking()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> uint32_t spin_lock_blocking </td>
          <td>(</td>
          <td class="paramtype">spin_lock_t *&#160;</td>
          <td class="paramname"><em>lock</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Acquire a spin lock safely. </p>
<p >This function will disable interrupts prior to acquiring the spinlock</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">lock</td><td>Spinlock instance </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>interrupt status to be used when unlocking, to restore to original state </dd></dl>

</div>
</div>
<a id="ga50945cb4c33c3263b69e1fce81c474c7" name="ga50945cb4c33c3263b69e1fce81c474c7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga50945cb4c33c3263b69e1fce81c474c7">&#9670;&nbsp;</a></span>spin_lock_claim()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void spin_lock_claim </td>
          <td>(</td>
          <td class="paramtype">uint&#160;</td>
          <td class="paramname"><em>lock_num</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Mark a spin lock as used. </p>
<p >Method for cooperative claiming of hardware. Will cause a panic if the spin lock is already claimed. Use of this method by libraries detects accidental configurations that would fail in unpredictable ways.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">lock_num</td><td>the spin lock number </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga41304e0ee0aed1b5c20b0fd8c2adf9e6" name="ga41304e0ee0aed1b5c20b0fd8c2adf9e6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga41304e0ee0aed1b5c20b0fd8c2adf9e6">&#9670;&nbsp;</a></span>spin_lock_claim_mask()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void spin_lock_claim_mask </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>lock_num_mask</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Mark multiple spin locks as used. </p>
<p >Method for cooperative claiming of hardware. Will cause a panic if any of the spin locks are already claimed. Use of this method by libraries detects accidental configurations that would fail in unpredictable ways.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">lock_num_mask</td><td>Bitfield of all required spin locks to claim (bit 0 == spin lock 0, bit 1 == spin lock 1 etc) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga157bccb525bdfd90255490558cbeb9c0" name="ga157bccb525bdfd90255490558cbeb9c0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga157bccb525bdfd90255490558cbeb9c0">&#9670;&nbsp;</a></span>spin_lock_claim_unused()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int spin_lock_claim_unused </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>required</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Claim a free spin lock. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">required</td><td>if true the function will panic if none are available </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the spin lock number or -1 if required was false, and none were free </dd></dl>

</div>
</div>
<a id="gad86f015d3ed475401bf83d9a0e449ab1" name="gad86f015d3ed475401bf83d9a0e449ab1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad86f015d3ed475401bf83d9a0e449ab1">&#9670;&nbsp;</a></span>spin_lock_get_num()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> uint spin_lock_get_num </td>
          <td>(</td>
          <td class="paramtype">spin_lock_t *&#160;</td>
          <td class="paramname"><em>lock</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Get HW Spinlock number from instance. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">lock</td><td>The Spinlock instance </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The Spinlock ID </dd></dl>

</div>
</div>
<a id="gad38821cab3d935b009c6551d5ff70c4c" name="gad38821cab3d935b009c6551d5ff70c4c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad38821cab3d935b009c6551d5ff70c4c">&#9670;&nbsp;</a></span>spin_lock_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">spin_lock_t * spin_lock_init </td>
          <td>(</td>
          <td class="paramtype">uint&#160;</td>
          <td class="paramname"><em>lock_num</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialise a spin lock. </p>
<p >The spin lock is initially unlocked</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">lock_num</td><td>The spin lock number </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The spin lock instance </dd></dl>

</div>
</div>
<a id="ga87b2474d96a8de8cdc6e083680a05bb9" name="ga87b2474d96a8de8cdc6e083680a05bb9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga87b2474d96a8de8cdc6e083680a05bb9">&#9670;&nbsp;</a></span>spin_lock_instance()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> spin_lock_t * spin_lock_instance </td>
          <td>(</td>
          <td class="paramtype">uint&#160;</td>
          <td class="paramname"><em>lock_num</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Get HW Spinlock instance from number. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">lock_num</td><td>Spinlock ID </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The spinlock instance </dd></dl>

</div>
</div>
<a id="ga9c66da8cbd0916461d6de2af4340ec4f" name="ga9c66da8cbd0916461d6de2af4340ec4f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9c66da8cbd0916461d6de2af4340ec4f">&#9670;&nbsp;</a></span>spin_lock_is_claimed()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool spin_lock_is_claimed </td>
          <td>(</td>
          <td class="paramtype">uint&#160;</td>
          <td class="paramname"><em>lock_num</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Determine if a spin lock is claimed. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">lock_num</td><td>the spin lock number </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if claimed, false otherwise </dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__hardware__sync.html#ga50945cb4c33c3263b69e1fce81c474c7" title="Mark a spin lock as used.">spin_lock_claim</a> </dd>
<dd>
<a class="el" href="group__hardware__sync.html#ga41304e0ee0aed1b5c20b0fd8c2adf9e6" title="Mark multiple spin locks as used.">spin_lock_claim_mask</a> </dd></dl>

</div>
</div>
<a id="ga177efc085451e4eabfc726897a59ca57" name="ga177efc085451e4eabfc726897a59ca57"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga177efc085451e4eabfc726897a59ca57">&#9670;&nbsp;</a></span>spin_lock_unclaim()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void spin_lock_unclaim </td>
          <td>(</td>
          <td class="paramtype">uint&#160;</td>
          <td class="paramname"><em>lock_num</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Mark a spin lock as no longer used. </p>
<p >Method for cooperative claiming of hardware.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">lock_num</td><td>the spin lock number to release </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gac4c9286f66d9dbe5287904d481f3b1e3" name="gac4c9286f66d9dbe5287904d481f3b1e3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac4c9286f66d9dbe5287904d481f3b1e3">&#9670;&nbsp;</a></span>spin_lock_unsafe_blocking()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> void spin_lock_unsafe_blocking </td>
          <td>(</td>
          <td class="paramtype">spin_lock_t *&#160;</td>
          <td class="paramname"><em>lock</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Acquire a spin lock without disabling interrupts (hence unsafe) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">lock</td><td>Spinlock instance </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga281ce69786da23cab7ba6c42537d4e87" name="ga281ce69786da23cab7ba6c42537d4e87"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga281ce69786da23cab7ba6c42537d4e87">&#9670;&nbsp;</a></span>spin_unlock()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> void spin_unlock </td>
          <td>(</td>
          <td class="paramtype">spin_lock_t *&#160;</td>
          <td class="paramname"><em>lock</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>saved_irq</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Release a spin lock safely. </p>
<p >This function will re-enable interrupts according to the parameters.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">lock</td><td>Spinlock instance </td></tr>
    <tr><td class="paramname">saved_irq</td><td>Return value from the <a class="el" href="group__hardware__sync.html#ga091e88a7608ed8dbf3e1e984bae54602">spin_lock_blocking()</a> function.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__hardware__sync.html#ga091e88a7608ed8dbf3e1e984bae54602" title="Acquire a spin lock safely.">spin_lock_blocking()</a> </dd></dl>

</div>
</div>
<a id="ga1cc04df1f5717292b279eb197ff5b4af" name="ga1cc04df1f5717292b279eb197ff5b4af"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1cc04df1f5717292b279eb197ff5b4af">&#9670;&nbsp;</a></span>spin_unlock_unsafe()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="group__pico__platform.html#ga23eadd8d1642fb8fe4600708c36e116a">__force_inline</a> void spin_unlock_unsafe </td>
          <td>(</td>
          <td class="paramtype">spin_lock_t *&#160;</td>
          <td class="paramname"><em>lock</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Release a spin lock without re-enabling interrupts. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">lock</td><td>Spinlock instance </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->

	<script src="main.js"></script>
</body>
</html>